import pandas as pd

def debug_columns():
    """调试钉钉表中各列的具体内容"""
    
    file_path = "d:/pycode/ding/宸著锦庭6月考勤.xlsx"
    df = pd.read_excel(file_path, skiprows=2)
    
    print("钉钉表前10行，前8列的详细数据:")
    print("="*80)
    
    # 显示前10行，前8列的数据
    for i in range(min(10, len(df))):
        print(f"\n第{i+1}行:")
        for j in range(min(8, len(df.columns))):
            col = df.columns[j]
            val = df.iloc[i, j]
            if pd.notna(val) and str(val).strip() != '':
                print(f"  列{j}({col}): {val}")
    
    # 专门检查第4列（索引3）的数据
    if len(df.columns) > 3:
        col_3 = df.columns[3]
        print(f"\n\n第4列({col_3})的所有非空数据:")
        print("-" * 50)
        data_3 = df[col_3].dropna()
        for i, val in enumerate(data_3):
            print(f"  {i+1}: {val}")
            # 检查是否是中文姓名
            val_str = str(val).strip()
            if 2 <= len(val_str) <= 4 and all('\u4e00' <= char <= '\u9fff' for char in val_str):
                print(f"      >>> 这是中文姓名!")
    
    # 也检查第3列（索引2）
    if len(df.columns) > 2:
        col_2 = df.columns[2]
        print(f"\n\n第3列({col_2})的所有非空数据:")
        print("-" * 50)
        data_2 = df[col_2].dropna()
        for i, val in enumerate(data_2):
            print(f"  {i+1}: {val}")
            # 检查是否是中文姓名
            val_str = str(val).strip()
            if 2 <= len(val_str) <= 4 and all('\u4e00' <= char <= '\u9fff' for char in val_str):
                print(f"      >>> 这是中文姓名!")

if __name__ == "__main__":
    debug_columns()